﻿using System.Windows.Forms;

namespace DesignerHelper.Addons.TemplateConvertor
{
    public static class FileFilter
    {
        private static string CtpxFilter => "切割板件文件(*.ctpx)|*.ctpx";
        private static string HwrxFilter => "五金件文件(*.hwrx)|*.hwrx";
        private static string EdgxFilter => "封边文件(*.edgx)|*.edgx";

        public static OpenFileDialog GetCtpxFileDialog()
        {
            OpenFileDialog op = new OpenFileDialog()
            {
                Filter = CtpxFilter,
                Title = "请选择切割板件文件",
                CheckPathExists = true,
                CheckFileExists = true,
                FilterIndex = 1,
                Multiselect = false,
                ValidateNames = true,

            };
            return op;
        }

        public static OpenFileDialog GetHwrxFileDialog()
        {
            OpenFileDialog op = new OpenFileDialog()
            {
                Filter = HwrxFilter,
                Title = "请选择五金件文件",
                CheckPathExists = true,
                CheckFileExists = true,
                FilterIndex = 1,
                Multiselect = false,
                ValidateNames = true,


            };
            return op;
        }

        public static OpenFileDialog GetEdgxFileDialog()
        {
            OpenFileDialog op = new OpenFileDialog
            {
                Filter = EdgxFilter,
                Title = "请选择封边文件",
                CheckPathExists = true,
                CheckFileExists = true,
                FilterIndex = 1,
                ValidateNames = true,
                Multiselect = false
            };
            return op;
        }

        public static SaveFileDialog GetNewCtpxSaveDialog()
        {
            SaveFileDialog dia = new SaveFileDialog
            {
                Title = "请选择文件存放位置",
                OverwritePrompt = true,
                AutoUpgradeEnabled = true,
                CheckPathExists = true,
                Filter = CtpxFilter,
                ValidateNames = true,
                DefaultExt = "ctpx",
                FileName = "newCtpx",
                
            };
            return dia;
        }
    }
}





